package com.huilian.iotbox.data.enums;

import lombok.Getter;

/**
 * @author 少凡
 * @date 2020/3/3 11:52
 */
@Getter
public enum DeviceAnnualFeeRecordStatusEnum {
    WAIT(0, "待付款"),
    SUCCESS(1, "支付成功"),
    CLOSE(2, "关闭"),
    CANCLE(3, "撤单"),
    REFUND(4, "退单"),
    FAIL(5, "失败"),
    PART_REFUND(6, "部分退款"),
    FULL_FERUND(7, "全额退款"),
    REFUNDING(8, "退款中"),
    REFUND_FAIL(9, "退款失败"),
    NEXT_DAY_REFUND(10, "隔天退款"),
    ;

    private Integer code;
    private String desc;

    DeviceAnnualFeeRecordStatusEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static String formatDesc(Integer code){
        DeviceAnnualFeeRecordStatusEnum[] values = DeviceAnnualFeeRecordStatusEnum.values();
        String desc = null;
        for (int i = 0; i < values.length; i++) {
            if (values[i].code.compareTo(code) == 0){
                desc = values[i].desc;
                break;
            }
        }
        return desc;
    }
}
